"""
构造中断请求的工厂

"""

from datetime import datetime


def create_name_approval_request(message: str) -> dict:
    return {
        "type": "getname_approval_request",
        "message": message
    }

def create_tool_approval_request(tool_name: str, tool_args: dict, tool_id: str) -> dict:
    formatted_date = datetime.now().isoformat()
    return {
        "type": "tool_approval_request",
        "tool_name": tool_name,
        "tool_args": tool_args,
        "tool_id": tool_id,
        "timestamp": formatted_date
    }


def create_tool_result_approval_request(tool_name: str, tool_args: dict, tool_result: str, tool_id: str) -> dict:
    """创建工具结果审批请求

    Args:
        tool_name: 工具名称
        tool_args: 工具参数
        tool_result: 工具执行结果
        tool_id: 工具ID

    Returns:
        dict: 工具结果审批请求字典
    """
    formatted_date = datetime.now().isoformat()
    return {
        "type": "tool_result_approval_request",
        "tool_name": tool_name,
        "tool_args": tool_args,
        "tool_result": tool_result,
        "tool_id": tool_id,
        "timestamp": formatted_date
    }